﻿<%@ Import Namespace="VirtuosoDal.Config" %>
<%@ Import Namespace="WebGuiMvc.Helpers.Paging" %>
<%
    string baseQueryString = PagingUrlHelper.GetPagingUrlTemplate(Request.RawUrl, Request.QueryString);

    var pagesCount = Model.PagesCount;
    //ToDo: Rework it
    if (pagesCount > PagingConfig.PageSize)
        pagesCount = PagingConfig.PageSize;
%>
<% 
   if (pagesCount != 1)
   {
%>
<p class="str">
    <%
        for (int i = 1; i <= pagesCount; i++)
        {
    %>
    <%
        if (i != Model.Page)
        {
    %>
            <a href="<%=String.Format(baseQueryString, i)%>" class="top">
                <%=i%>
            </a>
    <%
        }
        else
        {
    %>
            <%=i%>
    <%
        }
    %>
    <%
        }
    %>
    </p>
<%
   }
%>
<h2>
<%= ViewStrings.EventsStrings.Found %> 
<%= Model.ItemsCount %> 
<%= ViewData["Events"] %>
<% if (pagesCount != 1)
   {
%>
(<%= ViewStrings.EventsStrings.Displayed %> <%= Model.PageStartItemIndex %>-<%= Model.PageEndItemIndex %>)
<%
   }
%>
</h2>
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<AspNetMvc.Models.PagedModel<System.Collections.Generic.List<AspNetMvc.Models.EventForView>>>" %>